<template>
  <router-view />
</template>

<script setup>
  import { onMounted, nextTick } from 'vue';
  import useSettingsStore from '@/store/modules/settings';
  import { handleThemeStyle } from '@/utils/theme';

  function printVersion() {
    const gitInfo = {
      commitId: import.meta.env.VITE_GIT_COMMIT_ID,
      commitUserName: import.meta.env.VITE_GIT_COMMIT_USER_NAME,
      commitUserMail: import.meta.env.VITE_GIT_COMMIT_USER_MAIL,
      commitDate: import.meta.env.VITE_GIT_COMMIT_DATE,
      buildUserName: import.meta.env.VITE_GIT_BUILD_USER_NAME,
      buildUserMail: import.meta.env.VITE_GIT_BUILD_USER_MAIL,
      buildDate: import.meta.env.VITE_GIT_BUILD_DATE,
      message: import.meta.env.VITE_GIT_MESSAGE,
    };
    console.log(gitInfo);
  }

  printVersion();

  onMounted(() => {
    nextTick(() => {
      // 初始化主题样式
      handleThemeStyle(useSettingsStore().theme);
    });
  });
</script>
